package com.springboot.mapper;

import com.springboot.model.AppointmentMageInfo;
import com.springboot.model.OrderForm;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Mapper
public interface OrderFormMapper {
    int deleteByPrimaryKey(Integer bootId);

    int insert(OrderForm record);

    int insertSelective(OrderForm record);

    OrderForm selectByPrimaryKey(Integer bootId);

    int updateByPrimaryKeySelective(OrderForm record);

    int updateByPrimaryKey(OrderForm record);

    //通过三个外键查找预约表单,失败会返回null
    OrderForm selectByForeignKey(OrderForm record);

    //通过四个外键查找预约表单,失败会返回null
    OrderForm selectByForeignKey2(OrderForm record);

    //通过患者的ID查找预约表单
    ArrayList<OrderForm> selectByPatientId(Integer patientId);

    //通过doctor_id查找该医生的预约表
    ArrayList<OrderForm> selectByDoctorId(Integer id);

    //通过患者的ID查找已经就诊过的医生ID（不重复显示）
    List<Integer> selectDoctorIdByPatientId(Integer patientId);

    //通过doctorId和patientId查找预约表
    ArrayList<OrderForm> selectByDoubleId(OrderForm orderForm);

    OrderForm selectByFourAttribute(OrderForm orderForm);

    ArrayList<AppointmentMageInfo> selectAllOrderForm();
    //查询已就诊或未就诊的预约记录
    ArrayList<AppointmentMageInfo> selectVisitOrderForm(String queryString);
    //通过用户id查询预约记录
    ArrayList<AppointmentMageInfo> selectById(Integer id);
}